package com.ag.zhh.utils;

import com.ag.bean.TbContact;
import com.ag.bean.TbDept;
import com.ag.zhh.vo.Contact;
import com.ag.zhh.vo.Dept;

public class BeanToVO {
	
	public static Contact TbContactToContact(TbContact tbContact) {
		Contact contact = new Contact();
		if(tbContact == null)
			throw new NullPointerException();
		contact.setCCellphone(tbContact.getCCellphone());
		contact.setCFax(tbContact.getCFax());
		contact.setCId(tbContact.getCId());
		contact.setCName(tbContact.getCName());
		contact.setCTel(tbContact.getCTel());
		contact.setCVideo(tbContact.getCVideo());
		
		return contact;
	}
	
	public static Dept TbDeptToDeptWithoutContacts(TbDept tbDept) {
		Dept dept = new Dept();
		if(tbDept == null)
			throw new NullPointerException();
		
		dept.setDAddress(tbDept.getDAddress());
		dept.setDId(tbDept.getDId());
		dept.setDName(tbDept.getDName());
		return dept;
	}
	
}
